package com.yckj.day01;

/**
 * TODO 字符型和布尔类型
 *
 * @author shengyuee
 * @version 1.0
 * 2025/7/16 16:40
 */
public class TypeDemo3 {
    public static void main(String[] args) {
        // char取值范围[0,65535]或[0,2^16],占2个字节，无符号整数
        char ch1 = 'a';  // a的ASCII码是97
        System.out.println("ch1 = " + ch1);
        char ch2 = 98;
        System.out.println("ch2 = " + ch2);
        int ch22 = 98;
        System.out.println("ch22 = " + ch22);
       // char ch3 = -65; // 不能使用负数赋值
        char ch = '\u0000'; // 字符的初始值
        System.out.println("ch = " + ch);
        char ch4 = '中';
        System.out.println("ch4 = " + ch4);
        char ch5 = '0';
        System.out.println("ch5 = " + ch5);
        char ch6 = 65; // A的ASCII码是65
        // 0 的ASCII码是48
        boolean b1 = false; // boolean默认值为false
        b1 = true;
        System.out.println("b1 = " + b1);
       // b1 = 0; // 不能使用0和1赋值

    }
}
